@echo off
setlocal enabledelayedexpansion

set nopause=0
set args=

for %%A in (%*) do (
	if /I "%%A"=="pp" SET args=!args! pp
	if /I "%%A"=="nominify" SET args=!args! nominify
	if /I "%%A"=="nooptimize" SET args=!args! nooptimize
	if /I "%%A"=="nopause" SET nopause=1
)

call buildDebug.cmd nopause

set runJs=cscript //nologo
REM if exist jsdb set runJs=..\jsdb\jsdb
if exist v8cgi set runJs=..\v8cgi\v8cgi -c ..\v8cgi\v8cgi.conf

copy /y etc\* output\ >nul

cd output

echo.
echo Building Alkaline.js

%runJs% run_script.js buildRelease %args%

echo Done.

cd ..

copy /y output\Alkaline-all.js Alkaline.js >nul

if "%nopause%"=="0" pause

:endit
